<script setup>
import Footer from "@/components/Footer.vue";
import router from "@/router";
import { useRoute } from "vue-router";
import { ref, reactive, onMounted } from "vue"; 
import server from "@/utils/axiosUtils.js";
import { getOneHpService ,getOneMlService,createOrderService} from "@/api/hospital";
import { user } from "@/stores/counter.js";
import { ElMessage,ElMessageBox } from "element-plus";

const birthday = ref('');




const route = useRoute();

const userInfo = user();

onMounted(async () => {
  console.log(userInfo);
  const date=new Date(userInfo.birthday);
  birthday.value= date.toLocaleDateString('en-CA');
    
});


</script>

<template>
   
   
    <div class="wrapper">
        <header>
            <i class="fa fa-angle-left" onclick="history.go(-1)"></i>
            <p>个人信息查看界面</p>
            <div></div>
        </header>
        <div class="top-ban"></div>

        <section >
            <div class="title">
                <p>个人信息</p>
            </div>
            <table>
                <tr>
                    <td>姓名:</td>
                    <td>{{userInfo.realName}}</td>
                </tr>
               
                <tr>
                    <td>性别:</td>
                    <td>{{userInfo.sex === 1 ? '男' : '女'}}</td>
                </tr>
                <tr>
                    <td>证件号码:</td>
                    <td>{{userInfo.identityCard}}</td>
                </tr>
                <tr>
                    <td>出生日期:</td>
                    <td>{{birthday }}</td>
                </tr>
                <tr>
                    <td>手机号码:</td>
                    <td>{{userInfo.phone}}</td>
                </tr>
                <tr>
                    <td>用户名:</td>
                    <td>{{userInfo.userName}}</td>
                </tr>
                <tr>
                    <td>邮箱地址:</td>
                    <td>{{userInfo.email}}</td>
                </tr>
            </table>
           
          
           
        </section>
      
        <div class="bottom-ban"></div>
        <Footer>

        </Footer>
    </div>

</template>

<style scoped>
@import "@/assets/css/confirmorder.css";
@import "@/assets/framework/reset.css";
@import "@/assets/framework/font-awesome/css/font-awesome.min.css";
</style>
